import json from 'rollup-plugin-json'
import cjs2es from 'rollup-plugin-commonjs'
import resolve from 'rollup-plugin-node-resolve'
import babel from 'rollup-plugin-babel';

import htmlTemplate from 'rollup-plugin-generate-html-template'
import browsersync from 'rollup-plugin-browsersync'

export default {
    input: 'src/main.ts',
    output: {
        file: 'dist/bundle.js',
        format: 'es',

    },
    plugins: [
        resolve(),
        babel({
            exclude: 'node_modules/**'
        })
    ],
    plugins: [
        json(),
        cjs2es(),
        resolve(),
        htmlTemplate({
            template: 'src/html/template.html',
            target: 'dist/index.html',
        }),
        browsersync({
            server: 'dist',
        }),
    ]
}